package br.com.elfo.dado.negocio;

import android.content.ContentValues;
import android.media.MediaRecorder;

public class Microfone {

	MediaRecorder recorder;
	
	public Microfone(){
		recorder = new MediaRecorder();
		preparaCaptura();
	}
	
	public void preparaCaptura(){
		recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
		recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
		recorder.setOutputFile(path);
		recorder.prepare();
	}	
	public void start(){
		recorder.start();
	}
	public void stop(){
		recorder.stop();
	}
	public void capturarRuido(){
		start();
		stop();
		recorder.get
	}
	
	public void deacartar(){
		ContentValues values = new ContentValues(3);

	    values.put(Video.MediaColumns.TIMESTAMP, System.currentTimeMillis());
	    values.put(Video.MediaColumns.MIME_TYPE, recorder.getMimeContentType());
	    
	    contentResolver = new ContentResolver();
	    
	    ContentURI base = Video.Media.INTERNAL_CONTENT_URI;
	    ContentURI newUri = contentResolver.insert(base, values);
	    
	    if (newUri == null) {
	        // need to handle exception here - we were not able to create a new
	        // content entry
	    }
	    
	    String path = contentResolver.getDataFilePath(newUri);


	    
	}
	
	
	
}
